<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/base/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>${systemOption.systemTitle}</title>
    <%@ include file="/base/head.jsp"%>
    <script type="text/javascript" src="${ctx}/js/extendDataGrid.js"></script>
    <script type="text/javascript" charset="UTF-8">
    
	
	//根据不同值，显示不同内容
	function formatName(val,row){
		return '<a style="color:blue;">'+val+'</a>';
	}

	//根据不同值，显示不同内容
	function formatState(val,row){
		if (val == 1){
			return '<span style="color:red;">已离职</span>';
		}else if (val == 2){
			return '<span style="color:#C0FF3E;">离职中</span>';
		}else{
			return '<span >无</span>';
		}
	}
	
	function detail(){
	 	var row = $('#dimission').datagrid('getSelected');
	 	$('#xqdlg').show();	
	 	$('#xqdlg').dialog({
	 		title: '详情',   
		    width: 600,
		    height:500,
		    top:50,
		    closed : false,
			cache : false,
			maximizable : true,
			collapsible : false,
			minimizable : false,
		    href: '${ctx}/json/userDetail.action?id='+row.uiid,
		    cache: false, 
		    modal: true,
		    buttons:[{
		    	text:'关闭',
				iconCls:'icon-cancel',
				handler:function(){
					$('#xqdlg').dialog('close');
				}	    	
		    }]
	 	});	
	 } 
	
 </script>
  </head>
  
  <body>
    
<!-- 主窗口 -->  	 
    <table id="dimission" class="easyui-datagrid" data-options="fit:true,
    								rownumbers:true,
									singleSelect:true,
									striped:true,
									fitColumns:false,
									pagination:true,
									pageSize:20,
									pageList:[20,30,50,100],
									onDblClickRow:detail,
									url:'${ctx}/emp/listDim.action'">
		<thead >
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'id',hidden:true"></th>
				<th data-options="field:'uiid',hidden:true" ></th>
				<th data-options="field:'name',align:'center',formatter:formatName" width="150"><strong>姓名</strong></th>
				<th data-options="field:'lzrqStr',align:'center'" width="200" ><strong>离职日期</strong></th>
				<th data-options="field:'lzyy',align:'left',halign:'center'" width="300"><strong>离职原因</strong></th>
				<th data-options="field:'state',align:'left',halign:'center',formatter:formatState" width="150"><strong>状态</strong></th>
				<th data-options="field:'czrname',align:'center',halign:'center'" width="150"><strong>操作人</strong></th>
			</tr>
		</thead>
		
	</table>
	
	
	
	 <!-- 详情窗口 -->    
	<div id="xqdlg" style="display: none">
   	</div>
  </body>
</html>
